namespace AndyPike.Unfuddle.XmlEntityClassGenerator
{
    public class Property 
    {
        public string XmlName { get; private set; }
        public string Name { get; set; }
        public string Type { get; set; }
        public string Info { get; set; }
        
        public Property(string name, string type, string info)
        {
            XmlName = name;
            Name = Class.SafeName(name);
            Type = MapType(type);
            Info = info;
        }

        public string MapType(string type)
        {
            switch(type.ToLower())
            {
                case "integer":
                    return "int?";
                case "datetime":
                case "date":
                    return "DateTime";
                case "float":
                    return "float";
                case "boolean":
                    return "bool";
                default:
                    return "string";
            }
        }
    }
}